import query from '@dfeidao/atom-nodejs/db/query';
import { IncomingHttpHeaders } from 'http';
import { productid ,systemid} from '../../atom/config';
// 查询员工数据
interface Message {
	filter: {
		staff_no: string
	};

}

export default async function atom(message: Message, action_id: string, session_id: string, headers: IncomingHttpHeaders) {
	const p = query(action_id, session_id, systemid);
		p.prepare('department_staff', ['headimg', 'cabinet_staff_no','staff_name','deptname','post_name','sex','contact_number','politics_face','marital_status','staff_nation','education','departure_date','native_place','lo_reason','family_address','staff_state','phone_number'], { productid,staff_no:message.filter.staff_no}, 20,  1, [], []);
	const [dt] = await p.exec();

	const pp = query(action_id, session_id, systemid);
		pp.prepare('project_personnel', ['project_name', 'project_no','is_resident'], { productid,pub_user_no:message.filter.staff_no}, 20,  1, [], []);
	const [dp] = await pp.exec();
	return {dt,dp};
}
